package com.phpxiu.app.view.dialog;

import android.app.Dialog;
import android.content.Context;
import android.view.View;

import com.phpxiu.app.kkylive.R;

/**
 * Created by 吴金洲 on 2016/8/12
 */
@Deprecated
public class AdminListOperaMenus extends Dialog implements View.OnClickListener {
    private String uid;
    private int mPosition=0;
    private AdminListOperaCallBack operaCallBack;

    public AdminListOperaMenus(Context context) {
        super(context, R.style.menusDialog);
        init(context);
    }

    private void init(Context context) {
        setContentView(R.layout.admin_list_opera_menus);
        findViewById(R.id.base_view).setOnClickListener(this);
        findViewById(R.id.cancel_menu).setOnClickListener(this);
        findViewById(R.id.close_menu).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.cancel_menu:
                if (operaCallBack != null) {
                    operaCallBack.onCancelAdmin(uid,mPosition);
                }
                dismiss();
                break;
            case R.id.close_menu:
                dismiss();
                break;
            case R.id.base_view:
                dismiss();
                break;
            default:
                break;
        }
    }

    public void setOperaCallBack(AdminListOperaCallBack callBack) {
        operaCallBack = callBack;
    }

    public void show(String id,int position) {
        uid = id;
        mPosition=position;
        super.show();
    }

    /**
     * 对话框操作接口
     */
    public interface AdminListOperaCallBack {
        void onCancelAdmin(String uid, int position);
    }
}